<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>hsm-statechart: hsm/builder/hsm_builder.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="hsm-statechart.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">hsm-statechart
   &#160;<span id="projectnumber">0.5</span>
   </div>
   <div id="projectbrief">An easy to use hierarchical state machine for C and C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('hsm__builder_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">hsm_builder.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Declarative interface for defining states.  
<a href="#details">More...</a></p>

<p><a href="hsm__builder_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a49c23334d7e4fb5beb37cea807290a98"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a49c23334d7e4fb5beb37cea807290a98">HSM_HASH32</a>(string)</td></tr>
<tr class="memdesc:a49c23334d7e4fb5beb37cea807290a98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Macro for seeding hsmStringHash.  <a href="#a49c23334d7e4fb5beb37cea807290a98"></a><br/></td></tr>
<tr class="memitem:a830815b66309708bb1e5dd719df8fec9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a830815b66309708bb1e5dd719df8fec9">HSM_HASH32_CAT</a>(string, hash)</td></tr>
<tr class="memdesc:a830815b66309708bb1e5dd719df8fec9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Macro for joining a new hash with an old hash.  <a href="#a830815b66309708bb1e5dd719df8fec9"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:af6af9a3811b9ee199f1f51bbf02c3a5d"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#af6af9a3811b9ee199f1f51bbf02c3a5d">hsm_callback_process_ud</a> )(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *user_data)</td></tr>
<tr class="memdesc:af6af9a3811b9ee199f1f51bbf02c3a5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Event handler callback w/ user data.  <a href="#af6af9a3811b9ee199f1f51bbf02c3a5d"></a><br/></td></tr>
<tr class="memitem:a7f870e6800e890e96c119d4346ae6806"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="hsm__forwards_8h.html#aa0e37ff043d2dd5216cc762ca03046cb">hsm_context</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a7f870e6800e890e96c119d4346ae6806">hsm_callback_enter_ud</a> )(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *enter_data)</td></tr>
<tr class="memdesc:a7f870e6800e890e96c119d4346ae6806"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enter callback w/ user data.  <a href="#a7f870e6800e890e96c119d4346ae6806"></a><br/></td></tr>
<tr class="memitem:af4aa080a39934e5e8eeaf8abe52c8101"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a> )(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *action_data)</td></tr>
<tr class="memdesc:af4aa080a39934e5e8eeaf8abe52c8101"><td class="mdescLeft">&#160;</td><td class="mdescRight">Action callback w/ user data.  <a href="#af4aa080a39934e5e8eeaf8abe52c8101"></a><br/></td></tr>
<tr class="memitem:a523ed5e5de7876173ff26a3221a7177d"><td class="memItemLeft" align="right" valign="top">typedef hsm_bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a523ed5e5de7876173ff26a3221a7177d">hsm_callback_guard_ud</a> )(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *guard_data)</td></tr>
<tr class="memdesc:a523ed5e5de7876173ff26a3221a7177d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Guard callback w/ user data.  <a href="#a523ed5e5de7876173ff26a3221a7177d"></a><br/></td></tr>
<tr class="memitem:a09bec4a2ab99abadd3539bd4f87d6322"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a09bec4a2ab99abadd3539bd4f87d6322">hsm_callback_exit_ud</a></td></tr>
<tr class="memdesc:a09bec4a2ab99abadd3539bd4f87d6322"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exit callback w/ user data.  <a href="#a09bec4a2ab99abadd3539bd4f87d6322"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aee7b062ccc31bc4305f2bccc57e12438"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#aee7b062ccc31bc4305f2bccc57e12438">hsmStartup</a> ()</td></tr>
<tr class="memdesc:aee7b062ccc31bc4305f2bccc57e12438"><td class="mdescLeft">&#160;</td><td class="mdescRight">Builder initialization.  <a href="#aee7b062ccc31bc4305f2bccc57e12438"></a><br/></td></tr>
<tr class="memitem:add54a0bda2485a0dc53b187ee6683ac5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#add54a0bda2485a0dc53b187ee6683ac5">hsmShutdown</a> ()</td></tr>
<tr class="memdesc:add54a0bda2485a0dc53b187ee6683ac5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Builder shutdown.  <a href="#add54a0bda2485a0dc53b187ee6683ac5"></a><br/></td></tr>
<tr class="memitem:af802c1ccaffba3620ec41825c1757c26"><td class="memItemLeft" align="right" valign="top">hsm_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#af802c1ccaffba3620ec41825c1757c26">hsmStart</a> (<a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> hsm, const char *name)</td></tr>
<tr class="memdesc:af802c1ccaffba3620ec41825c1757c26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start the passed machine using the passed named state.  <a href="#af802c1ccaffba3620ec41825c1757c26"></a><br/></td></tr>
<tr class="memitem:add84704ce1ec360d3b5c8e54b81f3f79"><td class="memItemLeft" align="right" valign="top">hsm_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#add84704ce1ec360d3b5c8e54b81f3f79">hsmStartId</a> (<a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>, int)</td></tr>
<tr class="memitem:a5779f163e882967ac81477d847f2733b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a5779f163e882967ac81477d847f2733b">hsmState</a> (const char *name)</td></tr>
<tr class="memdesc:a5779f163e882967ac81477d847f2733b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declare a new state.  <a href="#a5779f163e882967ac81477d847f2733b"></a><br/></td></tr>
<tr class="memitem:a6fcf2030bd45065a782c496502ab7ac4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a6fcf2030bd45065a782c496502ab7ac4">hsmBegin</a> (const char *name, int len)</td></tr>
<tr class="memdesc:a6fcf2030bd45065a782c496502ab7ac4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a named state.  <a href="#a6fcf2030bd45065a782c496502ab7ac4"></a><br/></td></tr>
<tr class="memitem:af2b192ad0796df85a5834e89321fcfe1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#af2b192ad0796df85a5834e89321fcfe1">hsmOnEnter</a> (<a class="el" href="hsm__state_8h.html#af766d6e8715b04f423b490cc5a056bf1">hsm_callback_enter</a> entry)</td></tr>
<tr class="memdesc:af2b192ad0796df85a5834e89321fcfe1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify a callback for state entry.  <a href="#af2b192ad0796df85a5834e89321fcfe1"></a><br/></td></tr>
<tr class="memitem:a2ddbd2fe99f1164327b50ed121a5b007"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a2ddbd2fe99f1164327b50ed121a5b007">hsmOnEnterUD</a> (<a class="el" href="hsm__builder_8h.html#a7f870e6800e890e96c119d4346ae6806">hsm_callback_enter_ud</a> entry, void *user_data)</td></tr>
<tr class="memdesc:a2ddbd2fe99f1164327b50ed121a5b007"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify a callback for state entry w/ user data.  <a href="#a2ddbd2fe99f1164327b50ed121a5b007"></a><br/></td></tr>
<tr class="memitem:a2c74d225d427461f71d69a3af8367970"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a2c74d225d427461f71d69a3af8367970">hsmOnExit</a> (<a class="el" href="hsm__state_8h.html#a5a740484248abeee497979cbac897ac8">hsm_callback_action</a> exit)</td></tr>
<tr class="memdesc:a2c74d225d427461f71d69a3af8367970"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify a callback for state exit.  <a href="#a2c74d225d427461f71d69a3af8367970"></a><br/></td></tr>
<tr class="memitem:a99ba83050d5c6fb29f7eac6bb847d2ea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a99ba83050d5c6fb29f7eac6bb847d2ea">hsmOnExitUD</a> (<a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a> exit, void *user_data)</td></tr>
<tr class="memdesc:a99ba83050d5c6fb29f7eac6bb847d2ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify a callback for state exit w/ user data.  <a href="#a99ba83050d5c6fb29f7eac6bb847d2ea"></a><br/></td></tr>
<tr class="memitem:ac1108a3da927fc7e47767a37575869e1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#ac1108a3da927fc7e47767a37575869e1">hsmOnEvent</a> (<a class="el" href="hsm__state_8h.html#ae16cf40ef01c5e281d2fcb8bba8ac661">hsm_callback_process_event</a> process)</td></tr>
<tr class="memdesc:ac1108a3da927fc7e47767a37575869e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declare a new event handler.  <a href="#ac1108a3da927fc7e47767a37575869e1"></a><br/></td></tr>
<tr class="memitem:a9779629a8d1c719b3c5d5f0c761c8aee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a9779629a8d1c719b3c5d5f0c761c8aee">hsmOnEventUD</a> (<a class="el" href="hsm__builder_8h.html#af6af9a3811b9ee199f1f51bbf02c3a5d">hsm_callback_process_ud</a> process, void *process_data)</td></tr>
<tr class="memdesc:a9779629a8d1c719b3c5d5f0c761c8aee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declare a new event handler.  <a href="#a9779629a8d1c719b3c5d5f0c761c8aee"></a><br/></td></tr>
<tr class="memitem:ad02a84de3e1056d771ed345e72875bad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#ad02a84de3e1056d771ed345e72875bad">hsmIf</a> (<a class="el" href="hsm__state_8h.html#a75bddc6c285b72e7c14b011150df5ef8">hsm_callback_guard</a> guard)</td></tr>
<tr class="memdesc:ad02a84de3e1056d771ed345e72875bad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Begin the declaration of a new event handler.  <a href="#ad02a84de3e1056d771ed345e72875bad"></a><br/></td></tr>
<tr class="memitem:a3c715e83fa677bb6c049e590b2806dc0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a3c715e83fa677bb6c049e590b2806dc0">hsmIfUD</a> (<a class="el" href="hsm__builder_8h.html#a523ed5e5de7876173ff26a3221a7177d">hsm_callback_guard_ud</a> guard, void *guard_data)</td></tr>
<tr class="memdesc:a3c715e83fa677bb6c049e590b2806dc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Event handler initialization.  <a href="#a3c715e83fa677bb6c049e590b2806dc0"></a><br/></td></tr>
<tr class="memitem:a7a13b992abb25f35891dd3f9b01c0367"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a7a13b992abb25f35891dd3f9b01c0367">hsmAnd</a> (void *unimplemented)</td></tr>
<tr class="memitem:ab64332479fd99d255de9a877f4779a9b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#ab64332479fd99d255de9a877f4779a9b">hsmAndUD</a> (<a class="el" href="hsm__builder_8h.html#a523ed5e5de7876173ff26a3221a7177d">hsm_callback_guard_ud</a> guard, void *guard_data)</td></tr>
<tr class="memdesc:ab64332479fd99d255de9a877f4779a9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a guard to the current event handler.  <a href="#ab64332479fd99d255de9a877f4779a9b"></a><br/></td></tr>
<tr class="memitem:a3e2542f58c071b332082c72fd66df8bb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a3e2542f58c071b332082c72fd66df8bb">hsmGoto</a> (const char *name)</td></tr>
<tr class="memdesc:a3e2542f58c071b332082c72fd66df8bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">An event handler started by hsmIf(UD) should transition to the named state.  <a href="#a3e2542f58c071b332082c72fd66df8bb"></a><br/></td></tr>
<tr class="memitem:a87c549299d8b7c2800a9aa0017ae13f5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a87c549299d8b7c2800a9aa0017ae13f5">hsmGotoId</a> (int state)</td></tr>
<tr class="memdesc:a87c549299d8b7c2800a9aa0017ae13f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">An event handler started by hsmIf(UD) should transition to the id'd state.  <a href="#a87c549299d8b7c2800a9aa0017ae13f5"></a><br/></td></tr>
<tr class="memitem:a408a55e638ae683641e72e5a60e9a459"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a408a55e638ae683641e72e5a60e9a459">hsmRun</a> (void *unimplmented)</td></tr>
<tr class="memitem:a4a41d8370c3a2f4e44b404eb96993b77"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a4a41d8370c3a2f4e44b404eb96993b77">hsmRunUD</a> (<a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a> action, void *action_data)</td></tr>
<tr class="memdesc:a4a41d8370c3a2f4e44b404eb96993b77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Run an action after meeting the conditions for the current event handler.  <a href="#a4a41d8370c3a2f4e44b404eb96993b77"></a><br/></td></tr>
<tr class="memitem:a1b3b9447cfcb13c231a4814341987e0c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a1b3b9447cfcb13c231a4814341987e0c">hsmEnd</a> ()</td></tr>
<tr class="memdesc:a1b3b9447cfcb13c231a4814341987e0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Complete the declaration of a state started by <a class="el" href="hsm__builder_8c.html#a6fcf2030bd45065a782c496502ab7ac4" title="Define a named state.">hsmBegin()</a>.  <a href="#a1b3b9447cfcb13c231a4814341987e0c"></a><br/></td></tr>
<tr class="memitem:a93916a77098a9337d6ca88fd4b0c45af"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#a93916a77098a9337d6ca88fd4b0c45af">hsmResolve</a> (const char *name)</td></tr>
<tr class="memdesc:a93916a77098a9337d6ca88fd4b0c45af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return an hsm_state from a builder state.  <a href="#a93916a77098a9337d6ca88fd4b0c45af"></a><br/></td></tr>
<tr class="memitem:aee89776d61b3c812c2e1da067e3124da"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#aee89776d61b3c812c2e1da067e3124da">hsmResolveId</a> (int id)</td></tr>
<tr class="memdesc:aee89776d61b3c812c2e1da067e3124da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a core hsm_state from an id.  <a href="#aee89776d61b3c812c2e1da067e3124da"></a><br/></td></tr>
<tr class="memitem:abead08de3b20918050a7e90a741ff6ad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hsm__types_8h.html#a5041728bd5890050e49ba4506a83f86f">hsm_uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__builder_8h.html#abead08de3b20918050a7e90a741ff6ad">hsmStringHash</a> (const char *string, <a class="el" href="hsm__types_8h.html#a5041728bd5890050e49ba4506a83f86f">hsm_uint32</a> seed)</td></tr>
<tr class="memdesc:abead08de3b20918050a7e90a741ff6ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute a strlwr'd FNV-A hash.  <a href="#abead08de3b20918050a7e90a741ff6ad"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Declarative interface for defining states. </p>
<p>The builder is a layer on top of the core hsm statemachine code. The builder is a layer on top of the core hsm statemachine code. It is not necessary to use, or even include, the builder to use hsm-statechart. </p>

<p>Definition in file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>
</div><hr/><h2>Macro Definition Documentation</h2>
<a class="anchor" id="a49c23334d7e4fb5beb37cea807290a98"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HSM_HASH32</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">string</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Macro for seeding hsmStringHash. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>String to hash. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#abead08de3b20918050a7e90a741ff6ad" title="Compute a strlwr&#39;d FNV-A hash.">hsmStringHash</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00291">291</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<a class="anchor" id="a830815b66309708bb1e5dd719df8fec9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HSM_HASH32_CAT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">string, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">hash&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Macro for joining a new hash with an old hash. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>String to hash. </td></tr>
    <tr><td class="paramname">hash</td><td>Old hash value. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00298">298</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="af6af9a3811b9ee199f1f51bbf02c3a5d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>(* hsm_callback_process_ud)(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *user_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Event handler callback w/ user data. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__state_8h.html#ae16cf40ef01c5e281d2fcb8bba8ac661" title="A state&#39;s event handler callback.">hsm_callback_process_event</a>, <a class="el" href="hsm__builder_8h.html#a9779629a8d1c719b3c5d5f0c761c8aee" title="Declare a new event handler.">hsmOnEventUD</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00034">34</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<a class="anchor" id="a7f870e6800e890e96c119d4346ae6806"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="hsm__forwards_8h.html#aa0e37ff043d2dd5216cc762ca03046cb">hsm_context</a>(* hsm_callback_enter_ud)(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *enter_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enter callback w/ user data. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__state_8h.html#af766d6e8715b04f423b490cc5a056bf1" title="A state&#39;s enter callback.">hsm_callback_enter</a>, <a class="el" href="hsm__builder_8h.html#a2ddbd2fe99f1164327b50ed121a5b007" title="Specify a callback for state entry w/ user data.">hsmOnEnterUD</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00041">41</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<a class="anchor" id="af4aa080a39934e5e8eeaf8abe52c8101"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* hsm_callback_action_ud)(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *action_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Action callback w/ user data. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">status</td><td>Current state of the machine. </td></tr>
    <tr><td class="paramname">action_data</td><td>The userdata passed to the action callback.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__state_8h.html#a5a740484248abeee497979cbac897ac8" title="A state&#39;s action callback.">hsm_callback_action</a>, <a class="el" href="hsm__builder_8h.html#a4a41d8370c3a2f4e44b404eb96993b77" title="Run an action after meeting the conditions for the current event handler.">hsmRunUD</a>, <a class="el" href="hsm__builder_8h.html#a99ba83050d5c6fb29f7eac6bb847d2ea" title="Specify a callback for state exit w/ user data.">hsmOnExitUD</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00051">51</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<a class="anchor" id="a523ed5e5de7876173ff26a3221a7177d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef hsm_bool(* hsm_callback_guard_ud)(<a class="el" href="hsm__forwards_8h.html#aaed055d181b35182dc8c2830721dbdc9">hsm_status</a> status, void *guard_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Guard callback w/ user data. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">status</td><td>Current state of the machine. </td></tr>
    <tr><td class="paramname">guard_data</td><td>The userdata passed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Return <a class="el" href="hsm__types_8h.html#ae231908aca4879403ae108cf0f5c7a9c" title="1">HSM_TRUE</a> if the guard passes and the transition,actions should be handled; <a class="el" href="hsm__types_8h.html#a661d07d1e0324624dd94942951801df4" title="0">HSM_FALSE</a> if the guard filters the transition,actions.</dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__state_8h.html#a75bddc6c285b72e7c14b011150df5ef8" title="Guard callback.">hsm_callback_guard</a>, <a class="el" href="hsm__builder_8h.html#a3c715e83fa677bb6c049e590b2806dc0" title="Event handler initialization.">hsmIfUD</a>, <a class="el" href="hsm__builder_8h.html#ab64332479fd99d255de9a877f4779a9b" title="Add a guard to the current event handler.">hsmAndUD</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00062">62</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<a class="anchor" id="a09bec4a2ab99abadd3539bd4f87d6322"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a> <a class="el" href="hsm__builder_8h.html#a09bec4a2ab99abadd3539bd4f87d6322">hsm_callback_exit_ud</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Exit callback w/ user data. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__state_8h.html#af766d6e8715b04f423b490cc5a056bf1" title="A state&#39;s enter callback.">hsm_callback_enter</a>, <a class="el" href="hsm__builder_8h.html#a2ddbd2fe99f1164327b50ed121a5b007" title="Specify a callback for state entry w/ user data.">hsmOnEnterUD</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8h_source.html#l00069">69</a> of file <a class="el" href="hsm__builder_8h_source.html">hsm_builder.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="aee7b062ccc31bc4305f2bccc57e12438"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hsmStartup </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Builder initialization. </p>
<p><b>Must</b> be called before the very first. You can call <a class="el" href="hsm__builder_8c.html#aee7b062ccc31bc4305f2bccc57e12438" title="Builder initialization.">hsmStartup()</a> multiple times, but every new call requires a corresponding <a class="el" href="hsm__builder_8c.html#add54a0bda2485a0dc53b187ee6683ac5" title="Builder shutdown.">hsmShutdown()</a> </p>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00916">916</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="add54a0bda2485a0dc53b187ee6683ac5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hsmShutdown </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Builder shutdown. </p>
<p>Free all internally allocated memory. All states are freed. </p>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00926">926</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="af802c1ccaffba3620ec41825c1757c26"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hsm_bool hsmStart </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td>
          <td class="paramname"><em>hsm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start the passed machine using the passed named state. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">hsm</td><td>Machine to initialize </td></tr>
    <tr><td class="paramname">name</td><td>Name of state to start </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00961">961</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="add84704ce1ec360d3b5c8e54b81f3f79"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hsm_bool hsmStartId </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#af802c1ccaffba3620ec41825c1757c26" title="Start the passed machine using the passed named state.">hsmStart</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00955">955</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5779f163e882967ac81477d847f2733b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hsmState </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Declare a new state. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>Name relative to enclosing state; if no enclosing state, assumed to be the top state of a machine.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>int opaque handle to an internal name</dd></dl>
<p>This function is idempotent(!)</p>
<p>If you call it with the same name, in the same begin/end scope, in the same run of the app, you will get the same value back out. The value is <em>not</em> gaurenteed to be the same across different launches of the same application.</p>
<p>Names are combined using "::" as per the statechart spec. ex.: Parent::Child::Leaf</p>
<p>What this all means is you cannot have two top level states both called "Foo" in your application. You can however reuse states by within a statemachine provided they have different parents: ( ie. { Outer: { InnerA: Foo } { InnerB: Foo } } is okay ) </p>
<p>note: i actually tried pre-allocating hsmState objects and storing those in hsmGoto, but if the user code is using string names, the allocation has to know how/whether to copy the string; that's not always obvious until <a class="el" href="hsm__builder_8c.html#a6fcf2030bd45065a782c496502ab7ac4" title="Define a named state.">hsmBegin()</a></p>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00967">967</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a6fcf2030bd45065a782c496502ab7ac4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hsmBegin </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Define a named state. </p>
<p>Every <a class="el" href="hsm__builder_8c.html#a6fcf2030bd45065a782c496502ab7ac4" title="Define a named state.">hsmBegin()</a> must, eventually, be paired with a matching <a class="el" href="hsm__builder_8c.html#a1b3b9447cfcb13c231a4814341987e0c" title="Complete the declaration of a state started by hsmBegin().">hsmEnd()</a>, Until then, all operations, including calls including <a class="el" href="hsm__builder_8c.html#a5779f163e882967ac81477d847f2733b" title="Declare a new state.">hsmState()</a> are considered owned by this state.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>Unique identifier for the state. </td></tr>
    <tr><td class="paramname">len</td><td>Length of the name. If 0, builder treats the string as a literal, and does not copy the name.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The same state id that was passed in. </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00993">993</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="af2b192ad0796df85a5834e89321fcfe1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmOnEnter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__state_8h.html#af766d6e8715b04f423b490cc5a056bf1">hsm_callback_enter</a>&#160;</td>
          <td class="paramname"><em>entry</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Specify a callback for state entry. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">entry</td><td>Callback triggered on state enter </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01033">1033</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a2ddbd2fe99f1164327b50ed121a5b007"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmOnEnterUD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__builder_8h.html#a7f870e6800e890e96c119d4346ae6806">hsm_callback_enter_ud</a>&#160;</td>
          <td class="paramname"><em>entry</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Specify a callback for state entry w/ user data. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">entry</td><td>Callback triggered on state enter </td></tr>
    <tr><td class="paramname">user_data</td><td>Data passed to callback</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note:</dt><dd>user_data lifetime must be longer than the state descriptions </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#af2b192ad0796df85a5834e89321fcfe1" title="Specify a callback for state entry.">hsmOnEnter</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01023">1023</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a2c74d225d427461f71d69a3af8367970"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmOnExit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__state_8h.html#a5a740484248abeee497979cbac897ac8">hsm_callback_action</a>&#160;</td>
          <td class="paramname"><em>exit</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Specify a callback for state exit. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">exit</td><td>Callback triggered on state exit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a99ba83050d5c6fb29f7eac6bb847d2ea" title="Specify a callback for state exit w/ user data.">hsmOnExitUD</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01043">1043</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a99ba83050d5c6fb29f7eac6bb847d2ea"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmOnExitUD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a>&#160;</td>
          <td class="paramname"><em>exit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Specify a callback for state exit w/ user data. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">exit</td><td>Callback triggered on state exit </td></tr>
    <tr><td class="paramname">user_data</td><td>Data passed to callback</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note:</dt><dd>user_data lifetime must be longer than the state descriptions </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a2c74d225d427461f71d69a3af8367970" title="Specify a callback for state exit.">hsmOnExit</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01052">1052</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac1108a3da927fc7e47767a37575869e1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmOnEvent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__state_8h.html#ae16cf40ef01c5e281d2fcb8bba8ac661">hsm_callback_process_event</a>&#160;</td>
          <td class="paramname"><em>process</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Declare a new event handler. </p>
<p>Call the passed event handler function w/ user data.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">process</td><td>Event handler function to call when the state receives an event from the statemachine.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a9779629a8d1c719b3c5d5f0c761c8aee" title="Declare a new event handler.">hsmOnEventUD</a>, <a class="el" href="hsm__machine_8h.html#a2e5511e0812b7613e3d1e496908bc8d0" title="Send the passed event to the machine.">HsmSignalEvent</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01062">1062</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a9779629a8d1c719b3c5d5f0c761c8aee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmOnEventUD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__builder_8h.html#af6af9a3811b9ee199f1f51bbf02c3a5d">hsm_callback_process_ud</a>&#160;</td>
          <td class="paramname"><em>process</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>process_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Declare a new event handler. </p>
<p>Call the passed event handler function w/ user data.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">process</td><td>Event handler function to call when the state receives an event from the statemachine. </td></tr>
    <tr><td class="paramname">process_data</td><td>Data passed to callback when an event is sent to a state.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#ac1108a3da927fc7e47767a37575869e1" title="Declare a new event handler.">hsmOnEvent</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01072">1072</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="ad02a84de3e1056d771ed345e72875bad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmIf </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__state_8h.html#a75bddc6c285b72e7c14b011150df5ef8">hsm_callback_guard</a>&#160;</td>
          <td class="paramname"><em>guard</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Begin the declaration of a new event handler. </p>
<p>Call the passed guard function, Inly if the guard returns true <a class="el" href="hsm__types_8h.html#ae231908aca4879403ae108cf0f5c7a9c" title="1">HSM_TRUE</a> will the rest of the event trigger.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">guard</td><td>Boolean function to call. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a3c715e83fa677bb6c049e590b2806dc0" title="Event handler initialization.">hsmIfUD</a>, <a class="el" href="hsm__builder_8h.html#a7a13b992abb25f35891dd3f9b01c0367">hsmAnd</a>, <a class="el" href="hsm__builder_8h.html#a3e2542f58c071b332082c72fd66df8bb" title="An event handler started by hsmIf(UD) should transition to the named state.">hsmGoto</a>, <a class="el" href="hsm__builder_8h.html#a408a55e638ae683641e72e5a60e9a459">hsmRun</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01082">1082</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3c715e83fa677bb6c049e590b2806dc0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmIfUD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__builder_8h.html#a523ed5e5de7876173ff26a3221a7177d">hsm_callback_guard_ud</a>&#160;</td>
          <td class="paramname"><em>guard</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>guard_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Event handler initialization. </p>
<p>Call the passed guard function w/ user data only if the guard returns true <a class="el" href="hsm__types_8h.html#ae231908aca4879403ae108cf0f5c7a9c" title="1">HSM_TRUE</a> will the rest of the event trigger</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">guard</td><td>Boolean function to call. </td></tr>
    <tr><td class="paramname">guard_data</td><td>Data passed to callback. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01092">1092</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7a13b992abb25f35891dd3f9b01c0367"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmAnd </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>unimplemented</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Not Implemented. Use hsmAndUD with NULL userdata instead. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#ab64332479fd99d255de9a877f4779a9b" title="Add a guard to the current event handler.">hsmAndUD</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ab64332479fd99d255de9a877f4779a9b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmAndUD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__builder_8h.html#a523ed5e5de7876173ff26a3221a7177d">hsm_callback_guard_ud</a>&#160;</td>
          <td class="paramname"><em>guard</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>guard_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a guard to the current event handler. </p>
<p>Works the same as hsmIf except it doesn't create a new handler, only adds a new guard on to the existing one(s)</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">guard</td><td>Boolean function to call. </td></tr>
    <tr><td class="paramname">guard_data</td><td>Data passed to callback.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#ad02a84de3e1056d771ed345e72875bad" title="Begin the declaration of a new event handler.">hsmIf</a>. </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01102">1102</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3e2542f58c071b332082c72fd66df8bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmGoto </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>An event handler started by hsmIf(UD) should transition to the named state. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a87c549299d8b7c2800a9aa0017ae13f5" title="An event handler started by hsmIf(UD) should transition to the id&#39;d state.">hsmGotoId</a>, <a class="el" href="hsm__builder_8h.html#ad02a84de3e1056d771ed345e72875bad" title="Begin the declaration of a new event handler.">hsmIf</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01112">1112</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a87c549299d8b7c2800a9aa0017ae13f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmGotoId </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>An event handler started by hsmIf(UD) should transition to the id'd state. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">state</td><td>The id of a state returned by <a class="el" href="hsm__builder_8c.html#a5779f163e882967ac81477d847f2733b" title="Declare a new state.">hsmState()</a> or hsmRef() to transition to.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a3e2542f58c071b332082c72fd66df8bb" title="An event handler started by hsmIf(UD) should transition to the named state.">hsmGoto</a>, <a class="el" href="hsm__builder_8h.html#a5779f163e882967ac81477d847f2733b" title="Declare a new state.">hsmState</a>, <a class="el" href="hsm__builder_8h.html#a1b3b9447cfcb13c231a4814341987e0c" title="Complete the declaration of a state started by hsmBegin().">hsmEnd</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01118">1118</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a408a55e638ae683641e72e5a60e9a459"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmRun </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>unimplmented</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Not Implemented. Use hsmRunUD with NULL userdata instead. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a4a41d8370c3a2f4e44b404eb96993b77" title="Run an action after meeting the conditions for the current event handler.">hsmRunUD</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4a41d8370c3a2f4e44b404eb96993b77"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmRunUD </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__builder_8h.html#af4aa080a39934e5e8eeaf8abe52c8101">hsm_callback_action_ud</a>&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>action_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Run an action after meeting the conditions for the current event handler. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">action</td><td>The action to run. </td></tr>
    <tr><td class="paramname">action_data</td><td>User data passed to the action callback.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#ad02a84de3e1056d771ed345e72875bad" title="Begin the declaration of a new event handler.">hsmIf</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01128">1128</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1b3b9447cfcb13c231a4814341987e0c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hsmEnd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Complete the declaration of a state started by <a class="el" href="hsm__builder_8c.html#a6fcf2030bd45065a782c496502ab7ac4" title="Define a named state.">hsmBegin()</a>. </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a6fcf2030bd45065a782c496502ab7ac4" title="Define a named state.">hsmBegin</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l01138">1138</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="a93916a77098a9337d6ca88fd4b0c45af"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a> hsmResolve </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return an hsm_state from a builder state. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>String name of state </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The <a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030" title="Pointer to an hsm_state_rec.">hsm_state</a>; NULL if the named state hasn't been built. </dd></dl>
<dl class="section note"><dt>Note:</dt><dd>Requires that <a class="el" href="hsm__builder_8c.html#a1b3b9447cfcb13c231a4814341987e0c" title="Complete the declaration of a state started by hsmBegin().">hsmEnd()</a> has been called for the state in question. </dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#aee89776d61b3c812c2e1da067e3124da" title="Return a core hsm_state from an id.">hsmResolveId</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00949">949</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="aee89776d61b3c812c2e1da067e3124da"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a> hsmResolveId </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return a core hsm_state from an id. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>A state id returned by <a class="el" href="hsm__builder_8c.html#a5779f163e882967ac81477d847f2733b" title="Declare a new state.">hsmState()</a> or hsmRef(). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>The <a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030" title="Pointer to an hsm_state_rec.">hsm_state</a>; NULL if the named state hasn't been built. </dd></dl>
<dl class="section note"><dt>Note:</dt><dd>Requires that <a class="el" href="hsm__builder_8c.html#a1b3b9447cfcb13c231a4814341987e0c" title="Complete the declaration of a state started by hsmBegin().">hsmEnd()</a> has been called for the state in question.</dd></dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a93916a77098a9337d6ca88fd4b0c45af" title="Return an hsm_state from a builder state.">hsmResolve</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00937">937</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
<a class="anchor" id="abead08de3b20918050a7e90a741ff6ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="hsm__types_8h.html#a5041728bd5890050e49ba4506a83f86f">hsm_uint32</a> hsmStringHash </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="hsm__types_8h.html#a5041728bd5890050e49ba4506a83f86f">hsm_uint32</a>&#160;</td>
          <td class="paramname"><em>seed</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compute a strlwr'd FNV-A hash. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>String to hash. </td></tr>
    <tr><td class="paramname">seed</td><td>Seed value for hash.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="hsm__builder_8h.html#a49c23334d7e4fb5beb37cea807290a98" title="Macro for seeding hsmStringHash.">HSM_HASH32</a>, <a class="el" href="hsm__builder_8h.html#a830815b66309708bb1e5dd719df8fec9" title="Macro for joining a new hash with an old hash.">HSM_HASH32_CAT</a> </dd></dl>

<p>Definition at line <a class="el" href="hsm__builder_8c_source.html#l00025">25</a> of file <a class="el" href="hsm__builder_8c_source.html">hsm_builder.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_6c36b64852547327283732128225c9d7.html">hsm</a></li><li class="navelem"><a class="el" href="dir_5b150c98d512331766b70ba13b771be1.html">builder</a></li><li class="navelem"><a class="el" href="hsm__builder_8h.html">hsm_builder.h</a></li>
    <li class="footer">Generated on Sat Jul 7 2012 22:48:11 for hsm-statechart by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
  </ul>
</div>
</body>
</html>
